package com.merry.sb.redis;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * @author zouyb
 * redis的消息监听器。
 */
@Component
public class MyRedisMessageListener implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {
        // 处理接收到的消息
        String messageContent = new String(message.getBody());
        System.out.println("Received message: " + messageContent);
    }
}
